﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package com.yy.ui.controls {
    import flash.display.*;
    import com.fminutes.vinciUI.general.*;

    public class ToggleButton extends LabelButton {

        private var _selected:Boolean = false;
        private var _skin;

        public function ToggleButton(_arg1=null, _arg2:String="", _arg3:VinciFont=null, _arg4:Number=0, _arg5:Boolean=false){
            super(_arg1, _arg2, _arg3, _arg4, _arg5);
        }
        public function get selected():Boolean{
            return (this._selected);
        }
        public function set selected(_arg1:Boolean):void{
            if (this._selected != _arg1){
                this._selected = _arg1;
                this.setBg();
            };
        }
        override public function get skin(){
            return (this._skin);
        }
        override public function set skin(_arg1):void{
            this._skin = _arg1;
            this.setBg();
        }
        override protected function mouseOver():void{
        }
        override protected function mouseOut():void{
        }
        override protected function mouseDown():void{
        }
        override protected function mouseUp():void{
        }
        protected function setBg():void{
            var _local1:MovieClip;
            if ((this._skin is Array)){
                if ((this._skin as Array).length >= 2){
                    if (!this.selected){
                        this.background = this._skin[0];
                    } else {
                        this.background = this._skin[1];
                    };
                };
            } else {
                if ((this._skin is MovieClip)){
                    _local1 = (this._skin as MovieClip);
                    if (background != this._skin){
                        this.background = _local1;
                    };
                    if (_local1.totalFrames >= 2){
                        if (!this.selected){
                            _local1.gotoAndStop(1);
                        } else {
                            _local1.gotoAndStop(2);
                        };
                    };
                } else {
                    if ((this._skin is DisplayObject)){
                        background = (this._skin as DisplayObject);
                    } else {
                        background = null;
                    };
                };
            };
        }

    }
}//package com.fminutes.vinciUI.controls 
